package 观察者模式;

import java.util.ArrayList;
import java.util.List;

/**
 * 主题的具体实现1
 */
public class ConcreteSubject1 implements Subject {


    @Override
    public void attach(Observer observer) {
        OBSERVER_LIST.add(observer);
    }

    @Override
    public void delete(Observer observer) {
        OBSERVER_LIST.remove(observer);
    }

    @Override
    public void notifyAllObserver() {
        OBSERVER_LIST.forEach(Observer::update);
    }
}
